package com.mkb.utils;

import freemarker.template.TemplateMethodModelEx;
import freemarker.template.TemplateModelException;

import java.util.List;
import java.util.UUID;

public class FreeMarkerEnum implements TemplateMethodModelEx {

    @Override
    public Object exec(List args) throws TemplateModelException {
        if (args.size() == 0) {
            throw new TemplateModelException("参数错误");
        }
        String methodName = String.valueOf(args.get(0));
        String methodValue = null;
        if (args.size() > 1) {
            methodValue = String.valueOf(args.get(1));
        }
        if ("UUID".equals(methodName)) {
            return UUID.randomUUID();
        }


        return null;
    }



}
